﻿using Ecommerce.API.Application.Command.Eunmcommand;
using Ecommerce.Services.Eunm;
using MediatR;

namespace Ecommerce.API.Application.CommandHandlers.EunmHander
{
    public class EunmUpdateCommandHandler : IRequestHandler<EunmUpdateCommand, int>
    {
        private readonly IEunmServices services;

        public EunmUpdateCommandHandler(IEunmServices services)
        {
            this.services = services;
        }

        public Task<int> Handle(EunmUpdateCommand request, CancellationToken cancellationToken)
        {
            return services.UpdateEunm(new Domain.Eunm.Meunm() { Eid=request.Eid,Pid=request.Pid,MenuName=request.MenuName,Url=request.Url });
        }
    }
}
